<?php
/**
 * Created by PhpStorm.
 * User: 84071
 * Date: 2018-02-23
 * Time: 9:51
 */
namespace app\Common\validate;
use think\Validate;
class Comment extends Validate{
    protected $rule =   [
        'uid'  => 'require|number',
        'aid'  => 'require|number',
        'class'  => 'require',
//        'oid'  => 'unique:comment',
        'pid'  => 'number',
        'comment'  => 'require',
    ];

    protected $message  =   [
        'uid.require' => '用户名不得为空！',
        'uid.number' => '非法访问！',
        'aid.require' => '请选择要评论的主题！',
        'aid.number' => '评论主题选择错误！',
        'oid.unique' => '此订单已存在！',
        'pid.number' => '请引用的用户名！',
        'class.require' => '评论错误！',
        'class.number' => '评论错误！',
        'comment.require' => '评论不得为空！',

    ];
    protected $scene = [
        'add' => ['uid','aid','class','pid','comment'],
        'list' => ['uid'=>'number','aid'=>'number','class','pid'=>'number'],
    ];
}